package com.weblog.home.client;

import com.weblog.home.client.impl.CommentClientImpl;
import com.weblog.home.interceptor.FeignInterceptor;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2019/9/2215:37
 */
@FeignClient(value = "weblog-article",fallback = CommentClientImpl.class,configuration = FeignInterceptor.class)
public interface CommentClient {

    /**
     * 根据文章的aids集合查询评论总数
     * @param aids
     * @return
     */
    @PostMapping("comment/client/count")
    Result countCommentByAids(@RequestBody List<String> aids);

    /**
     * 查询总记录数
     * @return
     */
    @GetMapping("comment/client/sum")
    Result countTotal();
}
